package com.ray.controller;

import org.springframework.http.HttpRequest;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Controller
// @RequestMapping("/parent")
// 如果加@RequestMapping，则下面的url变为/parent/hello
public class HelloController

{
    @RequestMapping("/hello")
    @ModelAttribute
    String getHello(Model model)
    {
        model.addAttribute("msg", "Hello Annotation");
        return "hello";
    }
}
